{% extends "docker_engine/base.html" %}


{% load staticfiles %}

{% block extra-css %}
<link rel="stylesheet" type="text/css" href="{% static 'docker_engine/assets/fancybox/source/jquery.fancybox.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'docker_engine/assets/uniform/css/uniform.default.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'docker_engine/assets/chosen-bootstrap/chosen/chosen.css' %}" />
{% endblock %}


{% block content %}
<div id="page" class="dashboard">
    <!-- BEGIN SAMPLE FORM PORTLET-->   
    <div class="widget">
        <div class="widget-title">
            <h4><i class="icon-reorder"></i>Node Details</h4>                   
        </div>
        <div class="widget-body form">
            <!-- BEGIN FORM-->
            <form action="/docker/node/update/" method="post" class="form-horizontal">
                {% csrf_token %}
                <div class="control-group">
                    <label class="control-label" for="node_name">Node Name</label>
                    <div class="controls">
                        <input type="text" class="span6" name="node_name" value="{{ node.name }}" />
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="ip_address">IP Address</label>
                    <div class="controls">
                        <input type="text" class="span6" name="ip_address" value="{{ node.ip_address }}" />
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="role">Role</label>
                    <div class="controls">
                        <select class="span4 chosen" data-placeholder="Define the role of this node" name="role">
                            <option value=""></option>
                            <option value="M">Managing</option>
                            <option value="C">Computing</option>
                        </select>
                    </div>
                </div>

                <hr />

                <div class="control-group">
                    <label class="control-label"><b>Computing Resources</b></label>
                </div>

                <div class="control-group">
                    <label class="control-label" >CPU Cores</label>
                    <div class="controls">
                        <select class="span4 chosen" data-placeholder="Choose CPU cores" name="cpu" tabindex="1">
                            <option value=""></option>
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                            <option value="6">6</option>
                            <option value="7">7</option>
                            <option value="8">8</option>
                            <option value="9">9</option>
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                        </select>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="memory">Memory Capacity</label>
                    <div class="controls">
                        <div class="input-prepend input-append">
                            <input class="input-large" name="memory" type="text" value="{{ node.memory }}" /><span class="add-on">GB</span>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="io_read">I/O Read Limit</label>
                    <div class="controls">
                        <div class="input-prepend input-append">
                            <input class="input-large" name="io_read" type="text" value="{{ node.io_read }}" /><span class="add-on">MB/s</span>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="io_write">I/O Write Limit</label>
                    <div class="controls">
                        <div class="input-prepend input-append">
                            <input class="input-large" name="io_write" type="text" value="{{ node.io_write }}" /><span class="add-on">MB/s</span>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="net_send">Network Send Limit</label>
                    <div class="controls">
                        <div class="input-prepend input-append">
                            <input class="input-large" name="net_send" type="text" value="{{ node.net_send }}" /><span class="add-on">MB/s</span>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="net_receive">Network Receive Limit</label>
                    <div class="controls">
                        <div class="input-prepend input-append">
                            <input class="input-large" name="net_receive" type="text" value="{{ node.net_receive }}" /><span class="add-on">MB/s</span>
                        </div>
                    </div>
                </div>

                <div class="form-actions">
                    <a href="{% url 'node_update' %}"><button type="submit" class="btn btn-primary">Update</button></a>
                    <a href="{% url 'node_index' %}"><button type="button" class="btn">Cancel</button></a>
                </div>
            </form>
            <!-- END FORM-->             
        </div>
    </div>
    <!-- END SAMPLE FORM PORTLET-->
</div>
{% endblock %}


{% block extra-js %}
<script src="{% static 'docker_engine/assets/chosen-bootstrap/chosen/chosen.jquery.min.js' %}"></script>
<script src="{% static 'docker_engine/assets/uniform/jquery.uniform.min.js' %}"></script>
<script src="{% static 'docker_engine/assets/fancybox/source/jquery.fancybox.pack.js' %}"></script>
<script src="{% static 'docker_engine/js/node/all.js' %}"></script>
<script src="{% static 'docker_engine/js/node/new.js' %}"></script>
{% endblock %}